﻿import QtQuick 2.0
import MainWindow 1.0
import UpMainWindow 1.0
import QtQuick.Window 2.2

Item {
    id: rect
    anchors.fill: parent

    //底层opengl
    MainWindow{
        id: mainWindow
        SequentialAnimation on frame {
            NumberAnimation{ to: 200; duration: 5000; easing.type: Easing.Linear }
            NumberAnimation{ to: 0; duration: 5000; easing.type: Easing.Linear }
            loops: Animation.Infinite
            running: true
        }
    }

    //顶层opengl
    UpMainWindow{
        id: upmainWindow
        SequentialAnimation on frame {
            NumberAnimation{ to: 200; duration: 5000; easing.type: Easing.Linear }
            NumberAnimation{ to: 0; duration: 5000; easing.type: Easing.Linear }
            loops: Animation.Infinite
            running: true
        }
    }

    //中间层qml
    Rectangle {
        z: 0
        color: Qt.rgba(1, 1, 1, 0.7)
        radius: 10
        border.width: 1
        border.color: "white"
        anchors.fill: label
        anchors.margins: -10
    }

    Text {
        z: 2
        id: label
        color: "black"
        wrapMode: Text.WordWrap
        text: "Opengl 和 Qml 混合编程"
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.horizontalCenterOffset: 50
        y: 220
    }
}
